package demo05;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: YKH
 * Date: 2022-04-03
 * Time: 20:18
 */
public class Outer {
    int number = 10;
    //局部内部类
    public static void main(String[] args) {
        class Inner {
            public void in() {
                System.out.println("Inner method");
            }

            public void outNumber() {
                Outer out = new Outer();
                System.out.println(out.number);
            }
        }
        Inner inner = new Inner();
        inner.in();
        inner.outNumber();
        new Abc().hello();
    }
}
//匿名内部类
class Abc implements Hello {
    @Override
    public void hello() {
        System.out.println("Hello");
    }
}

 interface Hello {
    void hello();
}
